<?php
/**
 * Created by PhpStorm.
 * User: winleung
 * Date: 2019-10-23
 * Time: 23:37
 */

namespace app\api\validate;


use think\Validate;

class PharmacyOrder extends Validate
{
    protected $rule = [
        'order_id'   => 'require|integer',
        'status'   => 'require|integer|in:1,2,3,4',

        'order_status' => 'integer',
        'update_time' => 'integer',
        'cancel_from' => 'integer',
        'dm_id' => 'integer',
        'dm_name' => 'chsAlphaNum',
        'client_id' => 'chsAlphaNum',
        'dm_mobile' => 'chsAlphaNum',
    ];

    protected $message = [
        'order_id.require'   => '请输入订单id',
        'status.require'   => '请输入状态',
        'order_id.integer'   => '订单id必须为int',
        'status.integer'   => '状态必须为int',
        'status.in'   => '状态错误',
        'order_status.integer'   => '状态错误',
        'update_time.integer'   => '状态错误',
        'cancel_from.integer'   => '状态错误',
        'dm_id.integer'   => '状态错误',
        'client_id.chsAlphaNum'   => '状态错误',
        'dm_name.chsAlphaNum'   => '状态错误',
        'dm_mobile.chsAlphaNum'   => '状态错误',
    ];

    protected $scene = [
        'updatePharmacyOrderStatus'  => ['order_id', 'status'],
        'resendOrderToDada'  => ['order_id'],
        'controlDadaCallback'  => ['order_status', 'update_time', 'cancel_from', 'cancel_from', 'dm_id', 'dm_name', 'client_id', 'dm_mobile'],
    ];


}